%define commit 64206000bbf2d76486ca9e0b5c6a7d02b352fca9
%define commit_short %(echo %{commit} | head -c6)

Summary(ru_RU.UTF-8): Серверная часть системы судейства ИСАП
Summary:	Server part for ISAP system
Name:		isap-server
Version:	1.4
Release:	1.git%{commit_short}.1
License:	GPL
Group:		Networking/Other
Url:		https://hub.mos.ru/isap/isap-server
Vendor:		ISAP
Source0:	https://hub.mos.ru/isap/isap-server/-/archive/%{commit}/%{name}-%{commit}.tar.gz

BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: qt5-linguist-tools
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5TextToSpeech)

Requires: mariadb
Requires: mariadb-client
Requires: %{_lib}qt5sql5%{_isa}
Requires: %{_lib}qt5sql5-mysql%{_isa}
Requires: %{_lib}qt5texttospeech5%{_isa}


%description
%summary.

%description -l ru_RU.UTF-8
Программное обеспечение сервера для сбора оценок, отображения, ранжирования.

%files
%{_bindir}/%{name}
%{_sbindir}/isap-server-config
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_iconsdir}/hicolor/scalable/apps/%{name}.svg

#------------------------------------------------------------------

%prep
%setup -n %{name}-%{commit}

%build
%qmake_qt5 *.pro
%make_build

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_iconsdir}/hicolor/scalable/apps

install -p -m755 %{name} %{buildroot}%{_bindir}
install -p -m755 config/isap-server-config.sh %{buildroot}%{_sbindir}/isap-server-config
install -p -m644 config/apulti.sql %{buildroot}%{_datadir}/%{name}
install -m644 config/%{name}.desktop %{buildroot}%{_datadir}/applications
install -m644 config/%{name}.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps
